<template>
  <div class="search-page">
    <div class="search-header">
      <button class="back-btn" @click="back">
        <i class="fas fa-chevron-left"></i>
      </button>
      <div class="search-box">
        <input 
          type="text" 
          v-model="searchQuery" 
          placeholder="搜索歌曲、歌手"
          @keyup.enter="search"
        >
        <button class="search-btn" @click="search">
          <i class="fas fa-search"></i>
        </button>
      </div>
    </div>
    
    <div class="search-content">
      <p class="placeholder-text">输入关键词搜索音乐</p>
    </div>
  </div>
</template>

<script>
import { ref } from 'vue'

export default {
  name: 'SearchPage',
  emits: ['back'],
  setup(props, { emit }) {
    const searchQuery = ref('')
    
    const search = () => {
      if (searchQuery.value.trim()) {
        console.log('搜索:', searchQuery.value)
        // 实际项目中这里应该调用搜索API
      }
    }
    
    const back = () => {
      emit('back')
    }
    
    return {
      searchQuery,
      search,
      back
    }
  }
}
</script>

<style scoped>
.search-page {
  min-height: 100vh;
  background: white;
  padding: 20px;
}

.search-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #c62828;
  cursor: pointer;
  margin-right: 15px;
}

.search-box {
  flex: 1;
  display: flex;
  background: #f5f5f5;
  border-radius: 20px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 15px;
  font-size: 16px;
  outline: none;
}

.search-btn {
  background: none;
  border: none;
  padding: 10px 15px;
  color: #c62828;
  cursor: pointer;
}

.search-content {
  padding: 40px 20px;
  text-align: center;
}

.placeholder-text {
  color: #999;
  font-size: 16px;
}
</style>
